#include<stdio.h>
#include<stdio.h>
struct student
{
int num;
char name[20];
float score;
};
int main()
{
struct student Stu[5]={{10101,"Zhang",78},
{10103,"Wang",98.5},
{10106,"Li",86},
{10108,"Ling",73.5},
{10110,"Sun",100}};
struct student temp;
const int n=5;
int i,j,k;
printf("The order is:\n");
for(i=0;i<n-1;i++)
{ k=i;
for(j=i+1;j<n;j++)
if(Stu[j].score>Stu[k].score)
k=j;
temp=Stu[k];Stu[k]=Stu[i];Stu[i]=temp;
}
for(i=0;i<n;i++)
printf("%6d %8s %6.2f\n",Stu[i].num,Stu[i].name,Stu[i].score);
printf("\n");
return 0;
}
